package com.zkthink.ceres.member.dto;

import com.alibaba.fastjson.JSON;
import com.google.common.collect.Maps;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Map;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

/**
 * <p>
 * 实体类 会员标签
 *
 * </p>
 *
 * @author kellen
 * @since 2020-07-12
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Builder
@ApiModel(value = "MemberTagPageDTO", description = "会员标签 ")
public class MemberTagPageDTO implements Serializable {

  private static final long serialVersionUID = 1L;

  /**
   * 标签名称
   */
  @ApiModelProperty(value = "标签名称")
  @NotEmpty(message = "标签名称不能为空")
  @Length(max = 300, message = "标签名称长度不能超过300")
  private String name;
  /**
   * 1手动标签 2自动标签
   */
  @ApiModelProperty(value = "1手动标签 2自动标签")
  @NotNull(message = "1手动标签 2自动标签不能为空")
  private Integer type;
  /**
   * 满足条件 1满足任意一个 2满足所有
   */
  @ApiModelProperty(value = "满足条件 1满足任意一个 2满足所有")
  @NotNull(message = "满足条件 1满足任意一个 2满足所有不能为空")
  private Integer meetCondition;

  @ApiModelProperty(value = "客户数量")
  private Long tagCount = 0L;


  public static void main(String[] args) {
    Map<String, Object> data = Maps.newHashMap();
    Map<String, Object> time = Maps.newHashMap();
    time.put("type", "1");
    time.put("value", "1");
    data.put("lastConsumTime", time);
    data.put("totalConsumTimes", "2-3");
    data.put("totalConsumAmount", 100);
    Map<String, Object> config = Maps.newHashMap();
    config.put("config", data);
    System.out.println(JSON.toJSONString(config));
  }

}
